Affine Transformations
Introduction
Affine transformations extend the familiar world of linear transformations—rotations, scalings, shearings—by adding one crucial new capability: translation.
This lets us move points around the plane without altering their shape or orientation.
In this article, we explore how translations fit naturally into the same matrix‑based framework you already know, provided we switch from ordinary Euclidean coordinates to homogeneous coordinates.
Why Translation Is Not Linear
A linear transformation $T$ must satisfy:
- $T(u + v) = T(u) + T(v)$
- $T(cu) = c\,T(u)$
But translation by a vector $t = (a,b)$ sends $$(x,y) \mapsto (x + a,\, y + b).$$ This fails linearity because:
- $T(0,0) = (a,b) \neq (0,0)$
- The origin does not stay fixed.
So translation cannot be represented by a $2 \times 2$ matrix acting on $(x,y)$.
Yet in computer graphics, robotics, and geometry, we want a unified matrix framework.
The solution: homogeneous coordinates.
Homogeneous Coordinates
To incorporate translations into matrix multiplication, we embed 2D points into 3D space:
- A point $(x,y)$ becomes $(x, y, 1)$.
- A vector (direction) becomes $(x, y, 0)$.
Key ideas:
- The extra coordinate distinguishes points from directions.
- The value $1$ allows translation to appear as matrix multiplication.
- After applying a transformation, we convert back by ignoring the last coordinate.
This trick allows us to treat translations just like rotations and scalings—using matrices.
Translation Matrices
A translation by $(a,b)$ in homogeneous coordinates is represented by: $$\begin{pmatrix} 1 & 0 & a \\ 0 & 1 & b \\ 0 & 0 & 1 \end{pmatrix}$$ Applying it to a point $(x,y,1)$: $$\begin{pmatrix} 1 & 0 & a \\ 0 & 1 & b \\ 0 & 0 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \\ 1 \end{pmatrix} = \begin{pmatrix} x + a \\ y + b \\ 1 \end{pmatrix}$$ This is exactly the translation we want.
Combining Linear and Affine Transformations
Because translations now live inside matrices, we can combine them with rotations, scalings, and shearings simply by multiplying matrices.
Example: rotate then translate: $$\begin{pmatrix} R & t \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} \cos\theta & -\sin\theta & a \\ \sin\theta & \cos\theta & b \\ 0 & 0 & 1 \end{pmatrix}$$ This unified form is called an affine transformation matrix.
Properties:
- Affine transformations preserve straight lines.
- Parallel lines remain parallel.
- Shapes may rotate, scale, shear, or move.
This is why affine transformations are the backbone of computer graphics and geometric modeling.
Geometric Interpretation
In homogeneous coordinates:
- The first two rows describe how the plane is stretched, rotated, or sheared.
- The last column describes translation.
- The bottom row ensures everything behaves correctly.
Affine transformations allow us to:
- Move objects around the plane.
- Apply multiple transformations in sequence.
- Represent everything with matrix multiplication.
Exercises
- Write the translation matrix that moves points by $(3,-2)$.
- Apply the translation $(a,b)$ to the point $(4,1)$ using homogeneous coordinates.
- Convert the Euclidean point $(7,5)$ into homogeneous coordinates.
- Apply the matrix $$\begin{pmatrix}1 & 0 & 2 \\ 0 & 1 & 3 \\ 0 & 0 & 1\end{pmatrix}$$ to the point $(1,1)$.
- Describe in words what the matrix $$\begin{pmatrix}1 & 0 & a \\ 0 & 1 & b \\ 0 & 0 & 1\end{pmatrix}$$ does to any point in the plane.
- Combine a scaling by factor $2$ with a translation by $(1,1)$ into a single homogeneous matrix.
- True or false: In homogeneous coordinates, the point $(x,y,0)$ represents a location in the plane.
- Convert the affine matrix $$\begin{pmatrix}2 & 0 & -1 \\ 0 & 3 & 4 \\ 0 & 0 & 1\end{pmatrix}$$ into a description of its geometric effect.